package com.cha.chaApp.sys.goods.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cha.chaApp.sys.goods.dao.GoodsDao;
import com.cha.chaApp.sys.goods.service.GoodsService;
import com.cha.chaCommon.core.common.PageParam;
import com.cha.chaCommon.core.entity.hkf.Goods;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/*
@Author  hkf
@date 2024/11/12
--轻舟已过万重山--
*/
@Service
public class GoodsServiceImpl implements GoodsService {

    @Resource
    private GoodsDao goodsDao;
    @Override
    public Goods goodsInfoById(Integer goodsId) {
        Goods goods = goodsDao.selectById(goodsId);
        return goods;
    }

    @Override
    public Page<Goods> goodsAllInfo(PageParam param) {
        Page<Goods> page = new Page<>(param.getPageNum(), param.getPageSize());
        Page<Goods> goods = goodsDao.selectPage(page, null);
        return goods;
    }
}
